package com.rajaev.dtu.tractor.domain.repository.mysql;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface RoleResourceDao {

    /**
      插入角色和资源的对应关系
     * @param resourceIds
     * @param roleId
     * @return
     */
    Integer insertRoleResources(@Param("resourceIds") List<Integer> resourceIds,
                                @Param("roleId") Integer roleId);


    @Delete({
            "delete from t_role_resource where role_id = #{roleId}",
    })
    Integer deleteRoleResourceByRoleId(Integer roleId);
}
